using System;
using System.Collections.Generic;
using System.Text;
using FreeLancer.HRB.Services;

namespace FreeLancer.HRB.Core
{
  /// <summary>
  /// Global cache for the Core.
  /// </summary>
  public class GlobalCache
  {
    #region PageServiceInstance
    private static PageService _pageService;
    /// <summary>
    /// The PageService instance
    /// </summary>
    public static PageService PageServiceInstance
    {
      get
      {
        if (_pageService == null)
          _pageService = new PageService();

        return _pageService;
      }
    }
    #endregion

    #region PostServiceInstance
    private static PostsService _postService;
    /// <summary>
    /// The PostsService instance
    /// </summary>
    public static PostsService PostServiceInstance
    {
      get
      {
        if (_postService == null)
          _postService = new PostsService();

        return _postService;
      }
    }
    #endregion

    #region PostCommentServiceInstance
    private static PostCommentService _postCommentService;
    /// <summary>
    /// The PostsService instance
    /// </summary>
    public static PostCommentService PostCommentServiceInstance
    {
      get
      {
        if (_postCommentService == null)
          _postCommentService = new PostCommentService();

        return _postCommentService;
      }
    }
    #endregion

    #region CommentServiceInstance
    private static PostCommentService _commentService;
    /// <summary>
    /// The PostCommentService instance
    /// </summary>
    public static PostCommentService CommentServiceInstance
    {
      get
      {
        if (_commentService == null)
          _commentService = new PostCommentService();

        return _commentService;
      }
    }
    #endregion

    #region CategoriesService
    private static CategoriesService _categoriesService;
    /// <summary>
    /// The CategoriesService instance
    /// </summary>
    public static CategoriesService CategoriesService
    {
      get
      {
        if (_categoriesService == null)
          _categoriesService = new CategoriesService();

        return _categoriesService;
      }
    }
    #endregion

    #region ImagesService
    private static ImagesService _imagesService;
    /// <summary>
    /// The ImagesService instance
    /// </summary>
    public static ImagesService ImagesService
    {
      get
      {
        if (_imagesService == null)
          _imagesService = new ImagesService();

        return _imagesService;
      }
    }
    #endregion

    #region EventsService
    private static EventsService _eventsService;
    /// <summary>
    /// The EventsService instance
    /// </summary>
    public static EventsService EventsService
    {
      get
      {
        if (_eventsService == null)
          _eventsService = new EventsService();

        return _eventsService;
      }
    }
    #endregion
  }
}
